# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Zifei Tong <soariez@gmail.com>

pkgname=pkgdiff
pkgver=1.7.2
pkgrel=4
pkgdesc="A tool for analyzing changes in Linux software packages"
url="https://lvc.github.io/pkgdiff"
arch=('any')
license=('GPL2')
depends=('perl' 'diffutils' 'gawk' 'wdiff')
makedepends=('git')
source=("$pkgname-$pkgver.tar.gz::https://github.com/lvc/pkgdiff/archive/$pkgver.tar.gz"
        zstd.diff)
sha512sums=('2369488e9705280be9b326b07aa9ef0e211440921b9cce5c35560a14d1ad4ac0040eb54024a88a4a5f8f831208b43124c17a817a44840500b490c89bf877b904'
            '652bce3b278da6e592204ea360cdd3a389f8bf7cd6b25c20ada0140c06d67c45aa4473a1c4b0859f2f6f63893717eab7baa52fec4b47b335694cc7b51088fb2b')

prepare() {
  cd $pkgname-$pkgver

  # tar.zst support https://github.com/lvc/pkgdiff/issues/40
  patch -Np1 -i ../zstd.diff
}

package() {
  cd $pkgname-$pkgver

  mkdir -p "$pkgdir"/usr
  perl Makefile.pl --install --prefix=/usr --destdir="$pkgdir"
}
